<?php if (!defined('BASEPATH')) exit('No direct script access allowed');

class Access_library_siam
{
	// Constructor
	public function __construct()
	{
		if (!isset($this->CI))
		{
			$this->CI =& get_instance();
		}
	}

	// Public methods
	public function is_logged_in()
	{

        session_start();
        if ($this->CI->session->userdata('siamunp_user'))
		{
            if($this->CI->uri->segment(2) == 'login.html' || $this->CI->uri->segment(2) == 'login'){
              redirect('siam/biodata.html', 'location');
		      exit();
            }
            else return;
        }
		else
		{
            if($this->CI->uri->segment(2) != 'login.html' && $this->CI->uri->segment(2) != 'login'){
              redirect('siam/login/AuthWeb.do', 'location');
		      exit();
            }
		}
	}
}

/* Developed by Eka Prakarsa */
/* Contact me at ekaprakarsa@facebook.com*/